<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <title>首页</title>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <link rel="stylesheet" href="/AdminLTE-2.3.11/bootstrap/css/bootstrap.min.css"/>
  <link rel="stylesheet" href="/bootstrap-table/src/bootstrap-table.css"/>
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"/>
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css"/>
  <!-- Theme style -->
  <link rel="stylesheet" href="/AdminLTE-2.3.11/dist/css/AdminLTE.min.css"/>
  <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
        page. However, you can choose any other skin. Make sure you
        apply the skin class to the body tag so the changes take effect.
  -->
  <link rel="stylesheet" href="/AdminLTE-2.3.11/dist/css/skins/skin-blue.min.css"/>

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body class="hold-transition skin-blue">
<div class="wrapper">

  <!-- Main Header -->
  <header class="main-header">

    <!-- Logo -->
    <a href="#" class="logo">
      <span class="logo-lg"><b>东溪</b>励氏族谱</span>
    </a>

    <!-- Header Navbar -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">

    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">

      <!-- Sidebar user panel (optional) -->
      <div class="user-panel">
        <div class="pull-left image">
          <img src="/AdminLTE-2.3.11/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image"/>
        </div>
        <div class="pull-left info">
          <p>后台管理员</p>
          <!-- Status -->
          <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
        </div>
      </div>

      <ul class="sidebar-menu">
        <li class="header">菜单</li>
        <!-- Optionally, you can add icons to the links -->
        <li class="treeview">
          <a href="#"><i class="fa fa-link"></i> <span>族谱搜索</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="/sys/index">族谱树</a></li>
            <li><a href="/sys/zpSearch">成员搜索</a></li>
          </ul>
        </li>
        <li class="treeview">
          <a href="#"><i class="fa fa-link"></i> <span>族谱成员管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="/sys/addData">成员录入</a></li>
            <li><a href="/sys/update">成员更新</a></li>
            <li><a href="/sys/delete">成员删除</a></li>
          </ul>
        </li>
        <li class="treeview active">
          <a href="#"><i class="fa fa-link"></i> <span>族谱信息统计</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="/sys/stat">按世代统计人口数</a></li>
          </ul>
        </li>
        <li><a href="/"><i class="fa fa-link"></i> <span>图说东溪</span></a></li>
      </ul>
      <!-- /.sidebar-menu -->
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        按世代统计人口数
      </h1>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="col-lg-6">
        <div class="box box-primary">
          <table id="table"
                 data-toggle="table"
                 data-height="460"
                 data-url="/stat/getGene"
                 data-id-field="id">
            <thead>
            <tr>
              <th data-field="id" data-visible="false">id</th>
              <th data-field="gene">第几代</th>
              <th data-field="count">人数</th>
            </tr>
            </thead>
          </table>
        </div>
      </div>
      <div class="col-lg-6">
        <div class="box box-primary">
          <div class="box-header with-border">
            <div class="box-title">统计图表</div>
          </div>
          <div class="box-body">
            <div id="container" style="height: 400px">
            </div>
          </div>
        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <!-- Main Footer -->
  <footer class="main-footer">
    <!-- To the right -->
    <div class="pull-right hidden-xs">
      东溪励式族谱
    </div>
    <!-- Default to the left -->
    <strong>Copyright &copy; <a href="/">图说东溪</a>.</strong>
  </footer>

  <!-- Control Sidebar -->
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- REQUIRED JS SCRIPTS -->

<!-- jQuery 2.2.3 -->
<script src="/AdminLTE-2.3.11/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="/AdminLTE-2.3.11/bootstrap/js/bootstrap.min.js"></script>
<script src="/bootstrap-table/src/bootstrap-table.js"></script>
<script src="/bootstrap-table/src/locale/bootstrap-table-zh-CN.js"></script>
<!-- AdminLTE App -->
<script src="/AdminLTE-2.3.11/dist/js/app.min.js"></script>
<script src="/echarts/echarts.js"></script>
<!-- Optionally, you can add Slimscroll and FastClick plugins.
     Both of these plugins are recommended to enhance the
     user experience. Slimscroll is required when using the
     fixed layout. -->
<script>
  $(function () {
      $.post("/stat/getPieCell",null,function (data) {
          legendData=[]
          values=[]
          for(i in data){
              legendData.push(data[i]["name"])
              values.push(data[i]["value"])
          }
          var dom = document.getElementById("container");
          var myChart = echarts.init(dom);
          option = {
              xAxis: {
                  type: 'category',
                  data: legendData
              },
              yAxis: {
                  type: 'value'
              },
              series: [{
                  data: values,
                  type: 'bar'
              }]
          };
          myChart.setOption(option, true);
      })
  })
</script>
</body>
</html>
